package cn.itheima.web.action;

import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionSupport;
import com.opensymphony.xwork2.ModelDriven;

import cn.itheima.domain.User;
import cn.itheima.service.UserService;
import cn.itheima.service.impl.UserServiceImpl;

public class UserAction extends ActionSupport {

	private User user;
	UserService us = new UserServiceImpl();

	public User getUser() {
		return user;
	}

	public void setUser(User user) {
		this.user = user;
	}

	public UserService getUs() {
		return us;
	}

	public void setUs(UserService us) {
		this.us = us;
	}

	public String login() throws Exception {
		// 调用server将参数传入执行登录逻辑
		User u = us.login(user);
		// 将值传入

		return "toHome";
	}

}
